const path = require("path");
/*const ExtractTextPlugin = require("extract-text-webpack-plugin");
const extractLess = new ExtractTextPlugin({
  filename: "[name].[contenthash].css",
  disable: process.env.NODE_ENV === "development"
});*/
module.exports = {
  entry: path.join(__dirname, "lib/main.ts"),
  output: {
    path: path.join(__dirname, "build"),
    filename: "bundle.js"
    // We inferred the "public path" (such as / or /my-project) from homepage.
  },
  devtool: 'cheap-module-source-map',
  module: {
    rules: [
      {
        test: /\.(ts|tsx)$/,
        use: ['babel-loader', 'awesome-typescript-loader'],
        exclude: "/node_modules/"
      },
      {
        test: /\.less$/,
        use: [
          {
            loader: "style-loader"
          },
          {
            loader: "css-loader"
          },
          {
            loader: "less-loader",
            options: {
              strictMath: true,
              noIeCompat: true
            }
          }
        ],
        exclude: "/node_modules/"
      }
    ]
  },
  /*plugins: [
    extractLess
  ],*/
  resolve: {
    extensions: [".js", ".jsx", ".ts", ".tsx"]
  }
};
